package com.hzdl.house_mgr.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

/*
    订单号生成
 */
public class RentCodeUtil {

    public RentCodeUtil() {}

    public static String rentCode(){
        String rentCode = "rent_";

        SimpleDateFormat sdf = new SimpleDateFormat("YYYYMMdd_HHmmss_SSS");
        String format = sdf.format(new Date());
        rentCode += format;

        rentCode += "-";

        Random random = new Random();
        for(int i = 0;i<5;i++){
            int i1 = random.nextInt(10);
            rentCode += i1;
        }
        return rentCode;
    }
}
